package com.jiexinyun.utils;

/**
 * 根据二维码获取数据
 */
public class CodeUtils {

    public static final String getPhByCode(String code){
        String result = "";
        int lastDashIndex = code.lastIndexOf("-"); // 找到最后一个 "-" 的位置
        if (lastDashIndex != -1) {
            result = code.substring(0, lastDashIndex); // 截取 "-" 之后的部分
        } else {
        }
        return result;
    }

    public static final String getGongbumaByCode(String code){
        String result = "";
        int lastDashIndex = code.lastIndexOf("-"); // 找到最后一个 "-" 的位置
        if (lastDashIndex != -1) {
            result = code.substring(lastDashIndex + 1); // 截取 "-" 之后的部分
        } else {
        }
        return result;
    }

    public static void main(String[] args) {
        System.out.println(getGongbumaByCode("2025-07-29-01"));
        System.out.println(getPhByCode("2025-07-29-01"));
    }

}
